package at.irian.jsfatwork.broker.domain.client;

import at.irian.jsfatwork.broker.domain.BaseEntity;
import at.irian.jsfatwork.broker.domain.account.ClearingAccount;
import at.irian.jsfatwork.broker.domain.account.SecuritiesAccount;
import org.hibernate.annotations.ForeignKey;

import javax.persistence.*;

/**
 * @author Thomas Spiegl
 */
@Entity
public class Client extends BaseEntity {

    private Long id;

    private String userName;

    private String firstName;

    private String secondName;

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Basic(optional = false)
    @Column(unique = true)
    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    @Basic(optional = false)
    public String getFirstName() {
        return firstName;
    }

    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }

    @Basic(optional = false)
    public String getSecondName() {
        return secondName;
    }

    public void setSecondName(String secondName) {
        this.secondName = secondName;
    }


    @Transient
    public String getFullName() {
        return getFirstName() + " " + getSecondName();
    }

}
